//
//  secondViewController.swift
//  LLCustomNavigationBar
//
//  Created by 若望 on 2020/7/9.
//  Copyright © 2020 若望. All rights reserved.
//

import UIKit

class secondViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "second"
        // Do any additional setup after loading the view.
        self.view.backgroundColor = UIColor.green
        self.setNaviType()
        let btn = UIButton.init(frame: CGRect.init(x: 100, y: 300, width: 90, height: 90))
        self.view.addSubview(btn)
        btn.setTitle("push", for: .normal)
        btn.addTarget(self, action: #selector(push), for: .touchUpInside)
        btn.backgroundColor = UIColor.blue
        
        let bt1 = UIButton.init(frame: CGRect.init(x: 250, y: 300, width: 90, height: 90))
        self.view.addSubview(bt1)
        bt1.setTitle("dis", for: .normal)
        bt1.addTarget(self, action: #selector(dis), for: .touchUpInside)
        bt1.backgroundColor = UIColor.blue
    }
    
    func setNaviType()  {
        self.llBarTintColor = UIColor.yellow
        self.llTintColor = UIColor.black
        self.navigationController?.navigationBar.shadowImage = nil
        
        
        let dic = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 18), NSAttributedString.Key.foregroundColor: UIColor.black]
        self.llTitleTextAttributes = dic
    }
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
    }
    
    @objc func push() {
        let vc = thirdViewController()
        self.navigationController?.pushViewController(vc, animated: true)
    }
    @objc func dis() {
        self.navigationController?.dismiss(animated: true, completion: nil)
    }
}
